<?php
require_once 'Zend/Loader.php';
require_once 'services/Youtube.php';
require_once 'services/Twitter.php';

function debug_into_file($var)
{
    ob_start();
    var_dump($var);
    $contents = ob_get_contents();
    ob_end_clean();
    $contents .= PHP_EOL . '===========================================' . PHP_EOL;
    file_put_contents('amf_dump.html', $contents, FILE_APPEND);

}

$er = error_reporting(E_ERROR);
$loader = Zend_Loader::registerAutoload();
error_reporting($er);

$server = new Zend_Amf_Server();
$server->setClass('Youtube');
$server->setClass('Twitter');
$server->setProduction(false);
$response = $server->handle();
echo $response;